Skip to content

Conversation

@AHGIJMKLKKZNPJKQR
Copy link
Member

Logs showed that sometimes the agent doesn't close the game when time runs out, so we now do it instead

@AHGIJMKLKKZNPJKQR AHGIJMKLKKZNPJKQR self-assigned this Jan 27, 2026
Copilot AI review requested due to automatic review settings January 27, 2026 11:39
@linear
Copy link

linear bot commented Jan 27, 2026

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses an issue where games were not being properly terminated when the time limit was reached. The agent was previously responsible for calling endGame() after announcing time expiration, but this proved unreliable. The solution moves the responsibility for stopping the game to the backend's timeout handler.

Changes:

  • Backend now directly calls stopGame() after announcing time expiration instead of relying on the agent
  • Agent's timeout message simplified to remove instruction to call endGame()
  • Session state initialization improved by explicitly setting ending flag to false on open

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
deep-sea-stories/packages/backend/src/game/room.ts Added explicit stopGame() call in timeout handler to ensure game termination
deep-sea-stories/packages/backend/src/agent/gemini/session.ts Removed agent responsibility for calling endGame() and added state flag initialization

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AHGIJMKLKKZNPJKQR AHGIJMKLKKZNPJKQR merged commit b06a134 into main Jan 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants